package com.fowo.api.controller;

import com.fowo.api.common.model.R;
import com.fowo.api.model.accessories.AccessoriesVo;
import com.fowo.api.model.warehousebinrules.WarehouseBinRulesItemVo;
import com.fowo.api.model.warehousebinrules.WarehouseBinRulesSearchParamPo;
import com.fowo.api.service.WarehouseBinRulesService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "获取仓位")
@RequestMapping("/api/warehouse-bin-rules")
@RestController
public class WarehouseBinRulesController {
    @Resource
    private WarehouseBinRulesService warehouseBinRulesService;

    @Operation(summary = "获取仓位  根据 产品/店铺/仓库/fnsku ")
    @GetMapping("search")
    public R<WarehouseBinRulesItemVo> getSearch(WarehouseBinRulesSearchParamPo searchParamPo) {
        return R.data(() -> warehouseBinRulesService.search(searchParamPo));
    }
    @Operation(summary = "获取算法仓位   根据 产品/店铺/仓库/fnSku  ")
    @GetMapping("searchRules")
    public R<List<WarehouseBinRulesItemVo>> getSearchRules(WarehouseBinRulesSearchParamPo searchParamPo) {
        return R.data(() -> warehouseBinRulesService.searchRules(searchParamPo));
    }
}
